package com.kevin.common.constants;

import com.fasterxml.jackson.core.type.TypeReference;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 常量类
 *
 * @author wh
 * @date 2022-06-05
 */
public class Constants {
    /**
     * 答案选中值
     */
    public static String ANSWER_CHECKED = "1";
    /**
     * 答案选中值
     */
    public static Integer ANSWER_MAX_RETRY_COUNT = 3;
    /**
     * 答题重试间隔
     */
    public static Integer ANSWER_MAX_RETRY_INTERVAL = 150;
    /**
     * 失败
     */
    public static Integer FAIL = 0;
    /**
     * 成功
     */
    public static Integer SUCCESS = 1;
    /**
     * 根节点标识
     */
    public static final Long ROOT = 0L;

    /**
     * The value 1, with a scale of 0.
     *
     * @since 1.5
     */
    public static final BigDecimal BIG_DECIMAL_NEGATIVE_ONE = new BigDecimal("-1");

    /**
     * 默认日期格式
     */
    public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
    /**
     * 默认时间格式
     */
    public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";

    /** 存在Sa-Token session 里的key - user */
    public static final String SA_SESSION_KEY_USER = "USER";


    /**
     * 时间/秒 7天
     */
    public static final Long SECOND_SEVEN_DAY = 60 * 60 * 24 * 7L;

    /**
     * 时间/秒 1天
     */
    public static final Long SECOND_ONE_DAY = 60 * 60 * 24L;

    /** -1 */
    public static final BigDecimal BIG_DECIMAL_NAV_ONE = new BigDecimal("-1");

    /** 100 */
    public static final BigDecimal BIG_DECIMAL_HUNDRED = new BigDecimal("100");

    /** 3 */
    public static final BigDecimal BIG_DECIMAL_THREE = new BigDecimal("3");

    public static TypeReference<Map<String, Object>> MAP_REFERENCE = new TypeReference<Map<String, Object>>() {
    };

    public static com.alibaba.fastjson.TypeReference<Map<String, Object>> FASTJSON_MAP_REFERENCE = new com.alibaba.fastjson.TypeReference<Map<String, Object>>() {
    };

    public static final String[] LETTERS = new String[]{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};
}
